home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
gwada
/
readme
< prev
Wrap
Text File
|
1994-10-29
|
9KB
|
235 lines
INSTRUCTIONS
------------
Installation:
------------
On unzipping the file gw386.zip (using -d option), two directories
(bin and work) are created. `Bin' contains the executables and certain
support files necessary for the execution of this software. Setup a path
<path> to access the bin directory. Also set the ADAED environment
variable (set ADAED=<path>).The `Work' directory contains some Ada
packages which are required for the "Sample Run" described at the end of
this document. The software now uses the huge memory model (instead of
the compact memory model).
Introduction:
------------
An additional feature has been added to the GWAda Development
Environment. This feature allows the user to develop and test Ada
packages without writing driver programs (executable program units) to
test them. To enable this, the Environment has two modes now --
`Normal Mode' and `Package Unit Test Mode'. `Normal Mode' is the original
GWAda Environment window which appears on entering the environment. All
its original functions have been preserved. The `Package Unit Test Mode'
is used to test Ada packages and its operation has been outlined below.
General instructions to use this software follow immediately, but
the user may skip over to the "Sample Run" section given at the end.
To use the `Package Unit Test Mode':
----------------------------------
This mode allows the user to edit and test packages which meet certain
restrictions (see Unit Test restrictions on a package). Facility is
provided to automatically generate and run driver programs for these
packages. The driver programs operate in a manner similar to conventional
interpreters.
1. Once in the GWAda environment press F2 or ALT-O-M to switch to
Unit Test Mode.
2. The available top menus are:
FILE, EDIT, COMPILE, INSTRUMENT, RUN, WINDOW, OPTIONS, ADA, and HELP.
The menus FILE, EDIT, WINDOW, ADA, and HELP are identical to
those in the `Normal Mode' (Normal mode is the original screen
which appears when GWAda environment is first entered).
Only COMPILE, INSTRUMENT, RUN, and OPTIONS are different as
outlined below.
3. OPTIONS:
An additional menu item `Mode Normal' has been provided to swich
back to normal mode. Of course, the F2 hot key can also be used to
switch back and forth.
3. COMPILE:
This works similar to the COMPILE option in `Normal Mode'. In addition,
if you compile a package which meets the restrictions outlined in
section "Unit Test restrictions on a package", it appears under the
INSTRUMENT menu.
4. INSTRUMENT:
Select the package you want to instrument. This will automatically
generate, compile and, bind a driver (interpreter) for this package.
On success, the driver will appear under the RUN menu.
5. RUN:
Select the driver you want to run. This will take you to the
interpreter screen with a command line prompt which looks like ">".
See the section "To use the Interpreter" in order to use the
interpreter commands.
To use the Interpreter:
----------------------
1. The interpreter commands are as follows:
TYPES
TREE
OPS <type>
NEW <type>
OBJECTS <type>
HISTORY [<type>.]<object>
EXIT
HELP
<type> refers to the data type exported by the package under test.
<object> refers to the name of an instantiated object
2. TYPES:
Lists all the available data types which can be tested. It basically
lists the type exported by the package under test and also the type
exported by its ancestor packages (packages used by the package under
test recursively).
Example: If package PV exports type V, and uses packages PW and PX
which export types W and X respectively. Also, if package
PW uses package PZ which exports type Z then this command
will list the following:
V
W
X
Z
3. TREE:
Shows the type composition tree.
Example: Using the above example this command will show:
V depends on W
V depends on X
W depends on Z
4. OPS <type>:
Shows available operations of specified type. This provides a handy
lookup table when invoking operations on an object of a particular type.
Example: OPS V
5. NEW <type>:
Instantiates an object of a specified type and prompts the user for
its name.
Example: NEW V
Enter a name: Ob1
(This instantiates an object Ob1 of type V)
6. OBJECTS <type>:
Shows names of all available objects of specified type
Example: OBJECTS V -- may list the following objects
Ob1
Ob2
7. HISTORY [<type>.]<object>:
Shows a history of all commands invoked on specified object.
Example: HISTORY V.Ob1
... will show all commands invoked on object Ob1 of type V...
8. EXIT:
Exits the interpreter and returns to GWAda development environment
9. HELP:
Displays the above mentioned interpreter commands.
10. Operations (defined in the package under test):
All operations defined on available types can be invoked on
their objects.
Example: if a type STACK has operations
PUSH(in out STACK, INTEGER);
IS_EMPTY(in STACK); etc...
defined on it then they may be invoked on its objects S1, S2
as follows:
> STACK.PUSH(S1, 10);
> STACK.IS_EMPTY(S2);
Unit Test restrictions on a package:
-----------------------------------
Some of the following restrictions apply to the packages under test
because they (the packages) are expected to export abstract data types.
Other restrictions are there because this software is still under
development. Most of the restrictions (if not all) will be removed
in future versions of this product.
1. The Ada package under test must export exactly one type.
2. The package must be a non-generic.
3. The exported type should not be a derived type.
4. Every procedure or function in the package must pass the exported
type as a parameter.
5. The package under test must be present in the current directory.
6. To include ancestor types, their source files must be present in
the current directory.
Sample Run
----------
This run pertains to the sample package LISTPKG.ADA provided with this
software.
1. Invoke the GWAda Environment (and create a new library)
2. Press F2 to switch to `Package Unit Test Mode'
3. Compile EASY_IO.ADA and LISTPKG.ADA
4. Instrument LIST_PACKAGE
5. Run LIST_PACKAGE_DRIVER
6. At the ">" prompt, type the following commands. The interpreter
response is also shown below.
> HELP
INTERPRETER COMMANDS
----------- --------
types
tree
ops <Type>
objects <Type>
history [<Type>.]<Object>
help
new <Type>
exit
> TYPES
LIST
> OPS LIST
DISPLAY(IN LIST);
INSERT_HEAD(IN-OUT LIST; IN INTEGER);
INSERT_TAIL(IN-OUT LIST; IN INTEGER);
DEL_HEAD(IN-OUT LIST; OUT INTEGER);
COPY(IN-OUT LIST; IN LIST);
EQUAL(IN LIST; IN LIST) return BOOLEAN;
> NEW LIST
Enter a name: L1
> NEW LIST
Enter a name: L2
> DISPLAY(L1);
< >
> INSERT_HEAD(L1, 10);
> INSERT_HEAD(L1, 20);
> INSERT_TAIL(L1, 5);
> DISPLAY(L1);
< 20 10 5 >
> EQUAL(L1, L2);
Return Value = FALSE
> COPY(L2, L1);
> EQUAL(L1, L2);
Return Value = TRUE
> DISPLAY(L2);
< 20 10 5 >
> DEL_HEAD(L2, X);
X = 20
> DISPLAY(L2);
< 10 5 >
> EXIT
7. To run other packages, compile, interpret, and run QUEPKG.ADA and
STACKPKG.ADA. STACKPKG.ADA defines the package STACK_PACKAGE which
uses QUEUE_PACKAGE (defined in QUEPKG.ADA) which in turn uses
LIST_PACKAGE (defined in LISTPKG.ADA). STACK_PACKAGE exports type
STACK, which is basically a stack of queues.